enyo.kind({
	name: "hpit.Footer",
	kind: enyo.Control,
	classes: "hpit-footer",
	published: {
		submitLeftCaption: "",
		submitRightCaption: ""
	},
	events: {
		onSubmitLeft: "",
		onSubmitRight: "",
		onBack: ""
	},
	components: [
		{kind: "onyx.Toolbar", components: [
			{kind: "onyx.Grabber", ontap: "back"},
			{kind: "onyx.Button",name: "submitLeft", ontap:"submitLeft"},
			{kind: "onyx.Button",name: "submitRight", ontap:"submitRight"}
		]}
	],
	create: function() {
		this.inherited(arguments);
		this.submitLeftCaptionChanged();
		this.submitRightCaptionChanged();
	},
	submitLeftCaptionChanged: function() {
		if(this.submitLeftCaption == "") {
			this.$.submitLeft.setShowing(false);
		} else {
			this.$.submitLeft.content = this.submitLeftCaption;
		}
	},
	submitRightCaptionChanged: function() {
		if(this.submitRightCaption == "") {
			this.$.submitRight.setShowing(false);
		} else {
			this.$.submitRight.content = this.submitRightCaption;
		}
	},
	setSubmitLeftCaption: function(submitLeftCaption){
		if(submitLeftCaption == ""){
			this.$.submitLeft.setShowing(false);
		}else{
			this.$.submitLeft.content = submitLeftCaption;
			this.$.submitLeft.setShowing(true);
			this.$.submitLeft.render();
		}
	},
	setSubmitRightCaption: function(submitRightCaption){
		if(submitRightCaption == ""){
			this.$.submitRight.setShowing(false);
		}else{
			this.$.submitRight.content = submitRightCaption;
			this.$.submitRight.setShowing(true);
			this.$.submitRight.render();
		}
	},
	
	back: function(){
		this.doBack();
	},
	
	submitLeft: function(){
		this.doSubmitLeft();
	},
	
	submitRight: function(){
		this.doSubmitRight();
	},
});